package ooday01;

public class CarTest {
    public static void main(String[] args) {
        //创建一个Car对象
        Car c = new Car();
        //访问成员变量并赋值
        c.brand = "宝马";
        c.color = "红";
        c.price = 1000000;
        c.capacity = 5;
        //调用类的方法
        c.start();
        c.run();
        c.stop();

        Car ad = new Car();
        ad.brand = "奥迪";
        ad.color = "白";
        ad.capacity = 5;
        ad.price = 300000;
        ad.start();
        ad.run();
        ad.stop();

        Car bc = new Car();
        bc.start();
        bc.run();
        bc.stop();

        Car y = new Car("大众","黑",100000,5);
        y.start();

        Car a = new Car("奔驰","白",500000,4);
        a.start();

    }
}
